package com.lex.notepad;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.EditText;

/**
 * Created by Administrator on 2016/6/24.
 */
public class Notepad_pagesActivity extends Activity{
    private EditText pages_content;
    private SharedPreferences setting;
    private SharedPreferences.Editor editor;
    private String getInt;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_notepad_pages);
        Intent intent= getIntent();
        if (intent != null) getInt = intent.getStringExtra("new");
        setting = getSharedPreferences(getInt, MODE_PRIVATE);
        findView();
        initView();
    }

    protected void findView(){
        pages_content = (EditText) findViewById(R.id.pages_context);
    }

    protected void initView(){
    }

    @Override
    protected void onPause() {
        super.onPause();
        editor = setting.edit();
        editor.putString("iiiiiiiiiiiiii",pages_content.getText().toString());
        editor.commit();
    }

    @Override
    protected void onResume() {
        super.onResume();
        pages_content.setText(setting.getString("iiiiiiiiiiiiii",""));

    }
}
